package ua.net.gm.common.entity;

import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author Yason
 */
public class EntityTypeFactory
{  
    private final Map<String, EntityType> types;

    EntityTypeFactory()
    {
        types = new HashMap<>();
    }
    
    public EntityType createType(String type)
    {
        EntityType res = types.get(type);
        if (res == null)
        {
            res = new EntityType(type);
            types.put(type, res);
        }
        return res;
    }
}
